package com.ycl.web.backend;

import com.ycl.model.EbProductCategory;
import com.ycl.service.ProductClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/productClass")
public class ProductClassController {

    @Autowired
    private ProductClassService productClassService;

    @RequestMapping("/list")
    public String bigList(Model model){
        List<EbProductCategory> bigCategories = productClassService.bigList();
        model.addAttribute("bigCategories",bigCategories);

        List<EbProductCategory> smallCategories = productClassService.smallList();
        model.addAttribute("smallCategories",smallCategories);

        return "manage/productClass";
    }
}
